#!/bin/bash
# 获取uwsgi进程的PID
PID=$(ps aux | grep 'uwsgi --ini uwsgi.ini' | grep -v grep | awk '{print $2}')

# 如果找到了uwsgi进程，那么终止它
if [ ! -z "$PID" ]; then
    kill -9 $PID
fi

# 激活虚拟环境
source venv/bin/activate

# 重新启动uwsgi服务
nohup uwsgi --ini uwsgi.ini &
